/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cn.ekuma.epos.qkorder.report;

import cn.ekuma.epos.qkorder.ordermanager.OrderManager;
import com.openbravo.bean.erp.Order;
import net.sf.jasperreports.engine.JRDataSource;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JRField;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.data.JRAbstractBeanDataSourceProvider;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;

/**
 *
 * @author Administrator
 */
public class JROrderDataSourceProvider extends JRAbstractBeanDataSourceProvider{
   
    OrderManager orderManager;
    Order order;

    public JROrderDataSourceProvider(Class beanClass, OrderManager orderManager) {
        super(beanClass);
        this.orderManager = orderManager;
    }

    @Override
    public JRDataSource create(JasperReport arg0) throws JRException {
        return new JRBeanCollectionDataSource(orderManager.getPages());
    }

    @Override
    public void dispose(JRDataSource arg0) throws JRException {
       
    }

}
